package cn.zyq.ykb.beans.user;

import cn.zyq.ykb.system.annotation.Excel;
import cn.zyq.ykb.system.common.BaseBean;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户-提现记录对象 userCash
 *
 * @author SystemAuth
 * @date 2023-05-23
 */
@Data
@Entity
@Table(name = "`userCash`")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class UserCash  extends BaseBean implements Serializable {
    /**
     * 主键id，用于关联
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "JDBC")
    @Column(name = "`userCashID`")
    @ApiModelProperty("主键id，用于关联")
    private Integer userCashID;
    /**
     * 用户ID
     */
    @Column(name = "`userID`")
    @ApiModelProperty("用户ID")
    private Integer userID;
    /**
     * 提现金额
     */
    @Excel(name = "提现金额", sort = 2)
    @Column(name = "`price`")
    @ApiModelProperty("提现金额")
    private BigDecimal price;
    /**
     * 审核状态，0默认，1审核中，2审核通过，3拒绝，4审核驳回）
     */
    @Column(name = "`state`")
    @Excel(name = "审核状态", readConverterExp = "0=默认,1=审核中,2=审核通过,3=审核拒绝")
    @ApiModelProperty("审核状态，0默认，1审核中，2审核通过，3审核拒绝）")
    private Integer state;
    /**
     * 提现人名称
     */
    @Excel(name = "提现人名称", sort = 0)
    @Column(name = "`cashName`")
    @ApiModelProperty("提现人名称")
    private String cashName;
    /**
     * 提现账号
     */
    @Excel(name = "提现账号", sort = 1)
    @Column(name = "`cashAccount`")
    @ApiModelProperty("提现账号")
    private String cashAccount;
    /**
     * 审核人
     */
    @Column(name = "`auditID`")
    @ApiModelProperty("审核人ID")
    private Integer auditID;
    /**
     * 审核意见
     */
    @Column(name = "`auditReason`")
    @ApiModelProperty("审核意见")
    private String auditReason;
    /**
     * 审核时间
     */
    @Column(name = "`auditTime`")
    @ApiModelProperty("审核时间")
    private LocalDateTime auditTime;
    /**
     * 渠道ID
     */
    @Column(name = "`channelId`")
    @ApiModelProperty("渠道ID")
    private Integer channelId;
    /**
     * 审核编码
     */
    @Column(name = "`auditCode`")
    @ApiModelProperty("审核编号")
    private String auditCode;

    @Transient
    @ApiModelProperty("共计提现")
    private BigDecimal totalPrice;

    @Transient
    @ApiModelProperty("提现用户数据")
    private User user;
}
